import { IFeidaoAiWeappPage } from '../../../interfaces';
import render from '../render/render';

interface IEvent {
	target: {
		id: string;
		dataset: { [key: string]: string | number; };
	};
	detail: {
		value: string;
	};
}

export default async function bind(fd: IFeidaoAiWeappPage, args: any[]) {
	const e = args[0] as IEvent;
	const name = e.target.dataset.name as string;
	const value = e.detail.value;
	render(fd, { [name]: value });
}
